//The light class

#include "Light.h"


//default contstuctor
Light::Light() {}

//initialized constructor
Light::Light(Vector3 p, Color d, Color s) {
	position = p;
	diffuse = d;
	specular = s;
	t = -1;
	sphere = new Sphere(p, 0.5);
}

/*Light
*	The Light destructor.
*/
Light::~Light() {}

//Given a starting point and a direction vector, determines if a ray
//intersects a light
void Light::tIntersect(Vector3 p, Vector3 r) {
	//Object* obj;
	//sphere->tIntersect(p, r, obj);
	
	t = sphere->t1;
	
	if (sphere->t2 < t && sphere->t2 > 0) {
		t = sphere->t2;
	}
}